// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Author: Markus Gutschke

#ifndef MULTIPART_H__
#define MULTIPART_H__

#include <sys/types.h>

#include "hashmap.h"

struct MultiPart {
  struct HashMap contents;
};

enum MultiPartEncoding { M_MULTIPART, M_URLENCODED };

struct MultiPart *newMultiPart();
void initMultiPart(struct MultiPart *multipart);
void destroyMultiPart(struct MultiPart *multipart);
void deleteMultiPart(struct MultiPart *multipart);
void addToMultiPart(struct MultiPart *multipart, const char *name,
                    const char *content, ssize_t content_length,
                    const char *content_type);
const char *serializeMultiPart(const struct MultiPart *multipart,
                               enum MultiPartEncoding encoding);

#endif  // MULTIPART_H__
